fix(workflow): improve phase transition routing and progress detection#823
fix(workflow): improve phase transition routing and progress detection#823Tibsfox wants to merge 3 commits intogsd-build:mainfrom
Conversation
glittercowboy
left a comment
There was a problem hiding this comment.
Review Notes
#826 has been merged (Skill instead of Task for auto-advance), which affects this PR:
1. Progress detection (init.cjs) — Still valuable. The roadmap-aware phase counting is independent of the nesting changes.
2. Commit recovery (discuss-phase.md, plan-phase.md) — Now redundant. Since #826 eliminates deep Task nesting (using flat Skill calls instead), there are no deeply-nested agents whose commits could get lost. These files also now conflict with #826's changes.
3. AskUserQuestion routing (execute-phase.md, plan-phase.md) — Still a nice UX improvement, but plan-phase.md conflicts with #826.
Requested action: Rebase on main, drop the commit recovery sections from discuss-phase.md and plan-phase.md (no longer applicable), and resolve the merge conflicts in plan-phase.md with #826's Skill-based auto-advance.
fd0b6e8 to
c4a574a
Compare
init progress only counts phase directories on disk, so when all scaffolded phases are complete but ROADMAP.md defines more, the output shows completed_count === phase_count with next_phase: null. The progress workflow interprets this as "Milestone Complete" even when unscaffolded phases remain. Parse ROADMAP.md phase headings after the disk scan. Add a roadmap_phase_count field for the true total, and when all disk phases are complete, set next_phase to the first unscaffolded roadmap phase with a roadmap_only:true marker so consumers can distinguish it. Closes gsd-build#689 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When gsd-verifier returns human_needed, the execute-phase workflow displays a static text block listing test items but requires the user to manually discover and invoke /gsd:verify-work. Users may miss the items, proceed without testing, or not realize the phase is unverified. Replace the passive display with an AskUserQuestion offering three clear paths: start the verify-work UAT workflow, mark all items as approved, or review the full verification report before deciding. Closes gsd-build#117 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the static "Next Up" suggestion in <offer_next> with an AskUserQuestion offering to execute immediately, review plans, or clear context first. This only fires in the non-auto-advance case (auto-advance already handles the transition). Closes gsd-build#136 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c4a574a to
9e33fa5
Compare
|
Hey! Rebased on main — applied cleanly, all three commits preserved. Here's the rundown on each point: 1. Progress detection (init.cjs) — Agreed, completely independent of #826. Rebased without conflict. 2. Commit recovery sections — Investigated this thoroughly: the branch has zero changes to 3. AskUserQuestion routing — Both files rebased cleanly. In Tests passing (535/535). Ready for another look when you get a chance!
|
Summary
This PR improves the reliability of GSD's workflow transition layer — the handoffs between planning, execution, verification, and progress routing. Three issues addressed across 3 files, ~64 lines total.
Changes
1. Progress routing: include roadmap phases in init data — Closes #689
The experience: Running
/gsd:progressannounces "Milestone Complete! All phases finished!" even though 4+ phases remain in the roadmap — they just haven't been scaffolded to disk yet. This has reproduced consistently across multiple sessions for users with multi-phase milestones.Why it happens:
init progressbuilds its phase overview by scanning.planning/phases/directories. Phases defined in ROADMAP.md that haven't been planned yet don't have directories, sophase_countandcompleted_countend up equal. The progress workflow seescompleted_count === phase_countand routes to "Milestone Complete."The issue author identified this clearly: the
current_phase,next_phase,phase_count, andcompleted_countfields from init "look authoritative but only reflect disk state." The LLM treats this output as self-sufficient and skips theroadmap analyzestep that would reveal the unscaffolded phases.The fix: After the disk scan, parse ROADMAP.md for phase headings. Add a
roadmap_phase_countfield that reflects the true total from the roadmap. When all disk phases are complete but the roadmap defines more, setnext_phaseto the first unscaffolded phase (with aroadmap_only: truemarker so consumers can distinguish it from disk phases). The existingphase_countfield stays unchanged — it still means "directories on disk" — so existing consumers aren't affected.Files:
bin/lib/init.cjs(+33 lines)2. Verify-work routing after execution — Closes #117
The experience: When
gsd-verifierreturnshuman_needed, the execute-phase workflow displays a static text block listing items that need manual testing. But the user must manually discover and invoke/gsd:verify-workto actually perform the tests. Users may miss the items entirely, proceed to the next phase without testing, or not realize the phase is unverified.The fix: Replace the passive text display with an
AskUserQuestionoffering three clear paths:/clearrecommended for fresh context)This is complementary to PR #819 (browser pre-verification) — #819 makes the verification process itself smarter, while this fix makes the transition to verification automatic. They work well together.
Files:
workflows/execute-phase.md(+16 lines, -8 lines)3. Execute-phase offer after planning — Closes #136
The experience: After planning completes (in the non-auto-advance case), the workflow shows a static suggestion to run
/gsd:execute-phase. The user has to read the suggestion, understand it, and manually invoke the command. This creates an unnecessary friction point in the plan-execute loop.The fix: Add an
AskUserQuestionto the<offer_next>section offering to execute immediately, review plans first, or clear context for a fresh start. This only fires when auto-advance is NOT enabled — the auto-advance path (step 14) already handles the transition automatically.This is different from autopilot mode (#796): autopilot auto-advances through the full chain without asking. This fix is about the interactive case — offering a choice, not forcing execution. They're complementary features.
Files:
workflows/plan-phase.md(+15 lines, -12 lines)Verification
init progress— should showroadmap_phase_countreflecting the full ROADMAP count andnext_phasepointing to the first unscaffolded phase.execute-phaseon a phase where the verifier returnshuman_needed. Verify that an AskUserQuestion prompt appears offering/gsd:verify-work, "Mark approved", or "Review report".plan-phaseWITHOUT--auto. After planning completes, verify an AskUserQuestion prompt appears in<offer_next>offering to execute, review plans, or clear context.Overlap & Conflict Notes
This PR touches workflow files that are also modified by several active PRs from ethan-hurst:
Our diff is small (~64 lines) and each commit is atomic, so rebasing after any of these merge should be straightforward. The maintainer can also cherry-pick individual commits if preferred.
Relationship to PR #822
PR #822 fixes the foundation-level bugs (phase lifecycle scanning, milestone detection, state parsing) that these workflow improvements depend on. Specifically:
These PRs can merge independently, but together they address the full chain from data layer through workflow routing.
v2 Changes (rebase on main after #826)
Rebased on current
mainper reviewer request. The rebase applied cleanly — no conflicts.Regarding "commit recovery sections": After inspecting all three commits, neither
discuss-phase.mdnorplan-phase.mdcontain any commit recovery content. The branch has zero changes todiscuss-phase.md. Theplan-phase.mdchange only touches the<offer_next>section (replacing static "Next Up" text with AskUserQuestion routing), which is independent of #826's auto-advance<process>section. Both sections coexist cleanly.🤖 Generated with Claude Code